|
|
|
|
|
|
|
Visual Basic project and the Data Access class would be another, separate project. In order to effectively develop and test such an application, you have to simulate this interaction between projects. Fortunately, you can do so in several ways, as described here: |
|
|
|
|
|
|
|
|
Use a project group. Add multiple projects to the Project Explorer window. |
|
|
|
|
|
|
|
|
Use separate instances of Visual Basic. Launch Visual Basic again and load your ActiveX DLL in the second VB IDE. |
|
|
|
|
|
|
|
|
Use the compiled program. Use this method to share your classes with other developers. |
|
|
|
|
|
|
|
|
While you are reading through this section, consider a two-project situation: an ActiveX DLL project that contains a class and a Standard EXE project that uses the class. |
|
|
|
|
|
|
|
|
|
When accessing an ActiveX DLL from an ActiveX EXE project in any of the ways described in the preceding list, you always have to add a reference to the DLL by using the References dialog box. See the section ''Referencing and Using the DLL" later in this chapter.  |
|
|
|
|
|
|
|
|
|
|
You can create a project group in Visual Basic by choosing Add Project from the File menu. Each project in a group appears in the Project Explorer window, as shown in Figure 16.4. |
|
|
|
|
|
|
|
|
|
Creating a project group is different from the usual way you deal with multiple Visual Basic projects. Typically you would use the Open Project menu option, which causes the selected project to replace any currently open projects. When you create a project group, multiple projects are loaded in the development environment at the same time.  |
|
|
|
|
|
|
|
|
|
|
Figure 16.4
Project groups allow you to test
and debug ActiveX components in
a single instance of Visual Basic. |
|
|
|
|
|
|
|
|
The typical way you use project groups is to first create an ActiveX component and then add a Standard EXE project to test it. You can use Visual Basic's debugging features such as stepping into code and using breakpoints in all projects in the group. |
|
|
|
|
|
|
|
|
However, before you press Visual Basic's Start button, you may need to designate a Startup Project for the project group. By default, the first opened project is the Startup Project, and its name appears in boldface in the Project Explorer window. To set a different Startup Project, right-click the project's name and choose Set As Start Up. |
|
|
|
|
|